<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta charset="UTF-8">
    <title>books</title>
    <style>
        a{
            display: block;
            margin: 25px;
            text-decoration:none;
            padding: 15px;
            color: #0033FF;
        }
        a:hover{
            padding: 15px;
            display: block;
            margin: 25px;
            border-radius: 10px;
            background-color: #cccccc;
            text-decoration:none;
        }
    </style>
</head>
<body>
    <p style="margin-left: 40px;font-size: 10px;color: #666666">建议在浏览器中打开列表</p>
<ul id="movies_parent" style="list-style-type: none;padding: 0px">
</ul>


<script>
    const listView = document.getElementById("movies_parent");

    var data = [
         {"title": "一碗清汤芥麦面.pdf", "url": "https://divaid.github.io/resources/books/一碗清汤芥麦面.pdf"},
         {"title": "佐贺的超级阿嬷.txt", "url": "https://divaid.github.io/resources/books/佐贺的超级阿嬷.txt"},
         {"title": "解忧杂货铺.txt", "url": "https://divaid.github.io/resources/books/解忧杂货铺.txt"},
         {"title": "假如给我三天光明.txt", "url": "https://divaid.github.io/resources/books/假如给我三天光明.txt"},
         {"title": "在困难的日子里.txt", "url": "https://divaid.github.io/resources/books/在困难的日子里.txt"},
         {"title": "把梦留住.txt", "url": "https://divaid.github.io/resources/books/把梦留住.txt"},
         {"title": "童年(高尔基).txt", "url": "https://divaid.github.io/resources/books/童年(高尔基).txt"},
         {"title": "草房子.pdf", "url": "https://divaid.github.io/resources/books/草房子.pdf"},
         {"title": "小桔灯.txt", "url": "https://divaid.github.io/resources/books/小桔灯.txt"},
         {"title": "路遥文集.txt", "url": "https://divaid.github.io/resources/books/路遥文集.txt"},
         {"title": "平凡的世界.txt", "url": "https://divaid.github.io/resources/books/平凡的世界.txt"},
         {"title": "那山那人那狗.txt", "url": "https://divaid.github.io/resources/books/nashannarennagou.txt"},
         {"title": "人生.txt", "url": "https://divaid.github.io/resources/books/人生.txt"},
         {"title": "普罗旺斯的一年.txt", "url": "https://divaid.github.io/resources/books/普罗旺斯的一年.txt"},
         {"title": "重返普罗旺斯.txt", "url": "https://divaid.github.io/resources/books/重返普罗旺斯.txt"},
         {"title": "金盒子.txt", "url": "https://divaid.github.io/resources/books/金盒子.txt"},
         {"title": "天蓝色的彼岸.txt", "url": "https://divaid.github.io/resources/books/天蓝色的彼岸.txt"},
         {"title": "青铜葵花.txt", "url": "https://divaid.github.io/resources/books/青铜葵花.txt"},
         {"title": "海底两万里.txt", "url": "https://divaid.github.io/resources/books/海底两万里.txt"},
         {"title": "鲁滨逊漂流记.txt", "url": "https://divaid.github.io/resources/books/鲁滨逊漂流记.txt"},
         {"title": "狼图腾.txt", "url": "https://divaid.github.io/resources/books/狼图腾.txt"},
         {"title": "西游记.txt", "url": "https://divaid.github.io/resources/books/xiyouji.txt"},
         {"title": "guaimomotou.pdf", "url": "https://divaid.github.io/resources/books/guaimomotou.pdf"},
         {"title": "CuoreHeart爱的教育.pdf", "url": "https://divaid.github.io/resources/books/CuoreHeart爱的教育.pdf"},
         {"title": "简爱（英文版）.txt", "url": "https://divaid.github.io/resources/books/简爱（英文版）.txt"},
         {"title": "牛津书虫系列50本(英文版).txt", "url": "https://divaid.github.io/resources/books/牛津书虫系列50本(英文版).txt"},
         {"title": "格林童话英文版.txt", "url": "https://divaid.github.io/resources/books/格林童话英文版.txt"},
         {"title": "绿野仙踪(英文版).txt", "url": "https://divaid.github.io/resources/books/绿野仙踪(英文版).txt"},
         {"title": "哈利波特1-7英文版.txt", "url": "https://divaid.github.io/resources/books/哈利波特1-7英文版.txt"}
    ];

    function parseResult(){
        let innerString = "";
        for(let i =0; i<data.length; ++i){
            // if (data[i].title.indexOf(".pdf") > 0) {
            //     innerString+= "<li style='width: 100%'><a href=\"https://divaid.github.io/htmlminifuncs/pdfreader/web/viewer.html?url="+data[i].url+"\" target=\"_blank\">"+(i + 1)+"."+data[i].title+"</a></li>"
            // } else {
                innerString+= "<li style='width: 100%'><a href=\""+data[i].url+"\" target=\"_blank\">"+(i + 1)+"."+data[i].title+"</a></li>"
            // }
        }

        listView.innerHTML = innerString;
    }

    parseResult();

</script>

<!-- <script type="text/javascript" src="./js/getrequest.js"></script>
<script type="text/javascript">
    getRequest("https://divaid.github.io/htmlminifuncs/jsondata/books", "", function(res){
        // console.log(JSON.parse(res).data)
        data = JSON.parse(res).data;
        parseResult()
    })
    parseResult();
</script> -->

</body>
</html>
